<?php require_once ADMINVIEWPATH.'admin_header.php'; ?>
<?php require_once ADMINVIEWPATH.'admin_menu.php'; ?>
<!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="#">首页</a>
                        </li>
                        <li>
                            <a href="#">资料管理</a>
                        </li>
                        <li class="active"> 视频列表 </li>
                    </ul>
                </div>
                <!-- Page Body -->
                <div class="page-body">
                    <div class="row">
                        <div class="col-xs-12 col-md-12">
                            <div class="tab-content tabs-flat no-padding">
                                <div id="visits" class="tab-pane active animated fadeInUp">
                                    <div class="row">
                                        <div class="col-lg-12 chart-container">
                                            <div id="dashboard-chart-visits" class="chart chart-lg no-margin">
                                                <div class="widget-body">
                                                     <div class="table-toolbar">
                                                            <a href="/luckydog/video/textures" id="add_doc"   class=" btn btn-default">添加视频</a>
                                                        </div>
                                                        <table class="table table-striped table-bordered table-hover" id="simpledatatable">
                                                            <thead>
                                                                <tr>
                                                                    <th>ID</th>
                                                                    <th>标题</th>
                                                                    <th>封面</th>
                                                                    <th>所属分组</th>
                                                                    <th>添加时间</th>
                                                                    <th>添加人</th>
                                                                    <th>操作</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                            <tr>
                                                                <?php if(!empty($videoList)):?>
                                                                    <?php foreach($videoList as $key=> $row):?>
                                                                        <tr class="gradeX ">
                                                                            <td class="center"><?=$row['id']?></td>
                                                                            <td class="center"><?=$row['title']?></td>
                                                                            <td class="center"><img src="<?="/uploads/".$row['cover']?>" width="100"></td>
                                                                            <td class="center"><?=$row['department_name']?></td>
                                                                            <td class="center"><?=date("Y-m-d h:i",$row['addtime'])?></td>
                                                                            <td class="center"><?=$row['operationname']?></td>
                                                                            <td>
                                                                                <a href="/luckydog/video/textures?id=<?= $row['id'];?>" >编辑</a>&nbsp;|&nbsp;
                                                                                <a href="javascript:;" data = "<?=$row['id']?>" class="J_del">删除</a>
                                                                            </td>
                                                                        </tr>
                                                                    <?php endforeach;?>
                                                                <?php endif;?>
                                                            </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->
<script src="<?php echo STATICURL; ?>js/jquery-2.0.3.min.js"></script>
<script src="<?php echo STATICURL; ?>layer/layer.js"></script>
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>
<script src="<?=STATICURL; ?>layer/layer.js"></script>
<script>
    $(document).ready(function() {
        $(".J_del").click(function() {
            var id = $(this).attr("data");
            if (confirm("您确定要删除吗？")) {
                $.post("/luckydog/video/editStatus", {"id":id}, function(res) {
                    if (res) {
                        layer.msg("删除成功！");
                        window.location.reload();
                    }else{
                        layer.msg("删除失败！");
                    }
                });
            }
        });
    });

</script>


